export const state = () => {
  return {
    //检查是否开通乐贝
    open_shell: {
      code: 0,
      msg: "OK",
      data: {
        state: "1"
      }
    },
    currencys: [
      {
        name: "人民币",
        code: "CNY",
        symbol: "¥"
      },
      {
        name: "美元",
        code: "USD",
        symbol: "$"
      },
      {
        name: "港币",
        code: "HKD",
        symbol: "HK$ "
      },
      {
        name: "日元",
        code: "JPY",
        symbol: ""
      },
      {
        name: "加拿大元币",
        code: "CAD",
        symbol: ""
      },
      {
        name: "瑞尔",
        code: "KHR",
        symbol: ""
      }
    ],
    //
    currency_code: "CNY",
    shell_tag: [
      "恭喜你，本期账单空",
      "已出账单",
      "未出账单",
      "恭喜你，本期账单已经还清",
      "已逾期"
    ],
    shell_tips: {
      tag: "1",
      current_currency: "本币种账单剩余应还:202.00",
      text: "人民币,美元账单将11天后逾期"
    },
    shell_user: {
      str: "恭喜成为我们的铂金会员，请先到网页端完善资料",
      uid: "6d96f0cd038a78031243f239400a6afe",
      flow_status: "1"
    },
    //乐贝
    shell: {
      code: 0,
      msg: "OK",
      data: {
        user: {
          str: "资料正在审核中请耐心等待",
          uid: "6d96f0cd038a78031243f239400a6afe",
          flow_status: "1"
        },
        credit: {
          total_amount: "5000.0000",
          symbol_amount: "4072.39 CNY",
          symbol_frozen_amount: "85 CNY",
          symbol_sub_frozen_amount: "83 CNY",
          symbol_uncommit_amount: "6 CNY",
          symbol_sub_uncommit_amount: "0 CNY",
          symbol_cur_bill_unpay: "287.9 CNY",
          symbol_sub_cur_bill_unpay: "285.9 CNY",
          symbol_last_bill_unpay: "308.7 CNY",
          symbol_sub_last_bill_unpay: "180 CNY",
          name: "人民币",
          symbol: "¥"
        },
        guess_params: {
          tag: "1",
          current_currency: "本币种账单剩余应还:202.00",
          text: "人民币,美元账单将11天后逾期"
        }
      }
    },
    //获取乐呗相关情况
    get_shell: {
      code: 0,
      msg: "OK",
      data: {
        list: [
          {
            id: 2384,
            uid: "6d96f0cd038a78031243f239400a6afe",
            currency_code: "CNY",
            type: 0,
            default_amount: "5300.0000",
            total_amount: "5000.0000",
            used_amount: "701.0000",
            amount: "4299.0000",
            frozen_amount: 2,
            top_parentid: "6d96f0cd038a78031243f239400a6afe",
            sub_used_amount: "499.0000",
            uncommit_amount: 41,
            cur_bill_amount: 0,
            last_bill_amount: 330
          },
          {
            id: 2444,
            uid: "6d96f0cd038a78031243f239400a6afe",
            currency_code: "USD",
            type: 1,
            default_amount: "1000000.0000",
            total_amount: "1000000.0000",
            used_amount: "28246.0000",
            amount: "971754.0000",
            frozen_amount: 0,
            top_parentid: "6d96f0cd038a78031243f239400a6afe",
            sub_used_amount: "23355.0000",
            uncommit_amount: 0,
            cur_bill_amount: 16,
            last_bill_amount: 2259
          }
        ]
      }
    },
    //额度申请列表
    quota_list: {
      code: 0,
      msg: "OK",
      data: {
        total: 2,
        list: [
          {
            bill_id: "1809281552495674873",
            user_name: "公司1",
            apply_amount: "10000.0000",
            addtime: "1538121169",
            status: "-1",
            parentid: "0",
            currency_code: "CNY"
          },
          {
            bill_id: "1809281552144031365",
            user_name: "公司1",
            apply_amount: "1000.0000",
            addtime: "1538121134",
            status: "1",
            parentid: "0",
            currency_code: "CNY"
          }
        ]
      }
    },
    //自定义还款组合是否够还款
    repayment_gruop: {
      code: 0,
      msg: "OK",
      data: {
        state: "1"
      }
    },
    //还款
    repayment: {
      code: 0,
      msg: "OK",
      data: {
        state: 1
      }
    },
    //还款组合
    repayment_data_groups: [
      {
        amount: "0",
        currency: "CNY"
      }
    ],
    //还款数据
    repayment_data: {
      code: 0,
      msg: "OK",
      data: {
        bills: {
          type: "0",
          has_due: "0",
          month: "12.03",
          has_balance: "1",
          groups: [
            {
              amount: "48.2526",
              display_amount: "¥48.2526",
              name: "人民币",
              currency_code: "CNY",
              symbol: "¥"
            }
          ],
          list: [
            {
              name: "人民币",
              currency_code: "CNY",
              amount: "48.2526",
              unpay_amount: "48.2526"
            }
          ],
          str: "已出账单",
          has_usable: "1"
        },
        wallet: [
          {
            id: "722",
            uid: "541e81b3d377d209619c04166b05f92e",
            currency_code: "CNY",
            user_type: "1",
            amount: "501.0000",
            status: "1",
            name: "人民币"
          },
          {
            id: "729",
            uid: "541e81b3d377d209619c04166b05f93e",
            currency_code: "USD",
            user_type: "1",
            amount: "1855.2829",
            status: "1",
            name: "美元"
          }
        ]
      }
    }
  };
};

export const mutations = {
  SET_currency_code(state, data) {
    state.currency_code = data;
  },
  SET_repayment_data_groups(state, data) {
    state.repayment_data_groups = data;
  },
  SET_repayment_data(state, data) {
    console.log("SET_repayment_data");
    state.repayment_data = data;
  }
};

export const getters = {};

export const actions = {
  // async GET_AREA_CODE ({ commit }){
  //   try {
  //     let data = await this.$axios.get('/area_code.json');
  //     console.log(data);
  //   } catch (e) {
  //     throw e;
  //   }
  // }
};
